FROM ubuntu:latest
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
MAINTAINER fastjrun
ENV TIME_ZONE Asia/Shanghai
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && apt-get update && apt-get install -y tzdata && ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata && apt-get clean && rm -rf /tmp/* /var/cache/* /usr/share/doc/* /usr/share/man/* /var/lib/apt/lists/*
RUN apt update && apt install --no-install-recommends -y python3-pip git zip curl htop wget vim gcc libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++
RUN apt-get update && apt-get -y install ttf-wqy-zenhei
RUN mkdir -p /usr/share/fonts/truetype/
COPY msyh.ttf /usr/share/fonts/truetype/
RUN fc-cache -f -v
RUN mkdir -p /mnt/wisdiot_ai/
WORKDIR /mnt/wisdiot_ai/
COPY . /mnt/wisdiot_ai/
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && pip config set install.trusted-host mirrors.aliyun.com
RUN apt update && apt -y install python3.11 && apt-get -y install python3-pip
RUN pip3 install -r requirements.txt
RUN pip3 install --upgrade watchdog
CMD ["python3", "/mnt/wisdiot_ai/ai_api.py"]